From 5410fd6f5c6a5378384bbe7c883b25832ecff936 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=C3=86var=20Arnfj=C3=B6r=C3=B0=20Bjarmason?= Date: Wed, 21 Dec 2005 05:14:40 +0000 Subject: [PATCH] * Support configuring a permission required to view Special:Unwatchedpages --- includes/DefaultSettings.php | 6 ++++++ includes/SpecialUnwatchedpages.php | 5 +++++ 2 files changed, 11 insertions(+) diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index 1770080b98..deb8c37742 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -1394,6 +1394,12 @@ $wgExtraRandompageSQL = false; */ $wgEnableUnwatchedpages = false; +/** + * Users must have this permission to view Special:Unwatchedpages, e.g. + * 'protect' for only allowing >sysops. '' for none + */ +$wgUnwatchedPagesPermission = ''; + /** Allow the "info" action, very inefficient at the moment */ $wgAllowPageInfo = false; diff --git a/includes/SpecialUnwatchedpages.php b/includes/SpecialUnwatchedpages.php index 5ee52b3f6b..738cc278e3 100644 --- a/includes/SpecialUnwatchedpages.php +++ b/includes/SpecialUnwatchedpages.php @@ -57,6 +57,11 @@ class UnwatchedpagesPage extends QueryPage { * constructor */ function wfSpecialUnwatchedpages() { + global $wgUser, $wgUnwatchedPagesPermission, $wgOut; + + if ( ! $wgUser->isAllowed( $wgUnwatchedPagesPermission ) ) + return $wgOut->permissionRequired( $wgUnwatchedPagesPermission ); + list( $limit, $offset ) = wfCheckLimits(); $wpp = new UnwatchedpagesPage(); -- 2.20.1